﻿
jQuery(document).ready(function ($) {

    var oTable = $('#myDataTable').dataTable({
        "bServerSide": true,
        "sAjaxSource": "SanPham/AjaxHandler",
        "bProcessing": true,
        "aoColumns": [
                        {
                            "sName": "ID",
                            "bSearchable": false,
                            "bSortable": false,
                            "fnRender": function (oObj) {
                                return '<input type=\"checkbox\" id=\"checkbox1\">';
                            }
                        },
			            { "sName": "TenLoaiSP" },
			            { "sName": "TenThuongHieu" },
			            { "sName": "TenSanPham" },
    	                {
    	                    "sName": "AnhSanPham",
    	                    "bSearchable": false,
    	                    "bSortable": false,
    	                    "fnRender":function (oObj) {
    	                        return '<img alt=\"\" src=\Images/Anh San Pham/' + oObj.aData[4] + '\"/>';
    	                    }
    	                },
			            { "sName": "SoLuong" },
			            { "sName": "GiaGoc" },
    	                { "sName": "GiaBan" },
			            { "sName": "GiaKhuyenMai" },
			            { "sName": "BaoHanh" },
                         { "sName": "NgayNhapKho" },
                        {"sName":"XuatXu"},
                        {
                            "sName": "TrangThai",
                            "bSearchable": false,
                            "bSortable": false,
                            "fnRender": function(oObj) {
                                return '<input type=\"checkbox\" checked=\"'+oObj.aData[13]+'\" \/>';
                            }
                        }
        ]
    });
});
